<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <include file="Public/meta"/>
</head>
<body>

<div class="info-center">

    <!--顶部面包屑-->
    <div class="page-header">
        <div class="pull-left">
            <h4>{$res['topic']}:</h4>
        </div>
    </div>
    <!--清除浮动-->
    <div class="clearfix"></div>

    <!--表单-->
    <div class="table-margin">

        <form action="{:U('article/saveOneArticle')}" class="form-horizontal" method="post"
              enctype="multipart/form-data" onsubmit="return checkDirection()" id="form1">
            <input type="hidden" name="art_id" value="{$article_id}">
            <input type="hidden" id="type" name="" value="{$res['type']}">
            <table class="table table-hover contact-template-form">
                <tbody>
                <tr>
                    <td width="20%" align="right">文章标题：</td>
                    <td>
                        <input class="form-control w-300" type="text" name="title" value="{$data.title}">
                        {$data['name']}

                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">文章分类：</td>
                    <td>
                        <input class="form-control w-300" type="text" name="cat_id" value="{$data.category_id}">
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">文章来源：</td>
                    <td>
                        <input class="form-control w-300" type="text" name="from" value="{$data.from}">
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">文章内容：</td>
                    <td>
                        <textarea class="form-control" name="content" rows="25" cols="10">{$data.content}</textarea>
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">网站状态：</td>
                    <td>
                        <label>
                            <span class="inputword">开启</span>
                            <input checked="checked" class="xb-icheck" type="radio" name="state" value="1"
                            <eq name="data['state']" value="1"> checked="checked"</eq>
                            >
                        </label> &emsp;
                        <label>
                            <span class="inputword">关闭</span>
                            <input class="xb-icheck" type="radio" name="state" value="0"
                            <eq name="data['state']" value="0"> checked="checked"</eq>
                            >
                        </label>
                    </td>
                </tr>
                <tr>
                    <tD></td>
                    <td>
                        <input class="btn btn-primary" id="submit" type="submit" value="{$res['btn']}">
                        <a href="javascript:window.history.back(-1);" id="back" style="display: none;">   |返回</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>

    </div>
</div>
<script type="text/javascript" src="__ADMIN_JS__/common.js"></script>
<script>
    function checkDirection() {
        var type = $("#type").val();
        var form1 = $("#form1")
        if (type == 'edit' || type == 'add') {
            $("#form1").submit();
        } else {
            window.history.back(-1);
            return false;
        }
    }
    $(document).ready(function(){
        var type = $("#type").val();
        $("#back").show()
        if (type == 'read') {
            $("#back").hide()
//            $("#back").css('display','block');
            $(":input").attr("disabled","disabled");
            $("#submit").attr("disabled", false);
//            $("#submit").removeAttr("disabled");
            return false;
        }
    })
</script>


</body>
</html>
</body>
</html>